/***********************************************
/gen auto by zuitools
***********************************************/
#include "setActivity.h"

/*TAG:GlobalVariable全局变量*/
static ZKTextView* mTextNewMaxPtr;
static ZKTextView* mlocktimePtr;
static ZKTextView* mTextView23Ptr;
static ZKButton* mButton10Ptr;
static ZKButton* mButton9Ptr;
static ZKButton* mButton8Ptr;
static ZKTextView* mTextView30Ptr;
static ZKTextView* mTextView29Ptr;
static ZKTextView* mTextView27Ptr;
static ZKTextView* mTextView26Ptr;
static ZKSeekBar* mlockBarPtr;
static ZKButton* mlockSwitchPtr;
static ZKTextView* mTextView22Ptr;
static ZKWindow* mWindow4Ptr;
static ZKWindow* mlockWndPtr;
static ZKButton* msoundSwitchPtr;
static ZKTextView* mName1Ptr;
static ZKTextView* mTextView28Ptr;
static ZKButton* mButton_backPtr;
static ZKButton* mButton6Ptr;
static ZKButton* mButton5Ptr;
static ZKWindow* mWindow3Ptr;
static ZKWindow* msoundWndPtr;
static ZKTextView* mVersionTip0Ptr;
static ZKButton* mUpdateOkButtonPtr;
static ZKButton* mhideNewPtr;
static ZKTextView* mVersionTipNewPtr;
static ZKTextView* mTextView21Ptr;
static ZKWindow* mNewVersionWndPtr;
static ZKButton* mhide2Ptr;
static ZKButton* mresetPtr;
static ZKTextView* mTextupdateValuePtr;
static ZKTextView* mVersionTip1Ptr;
static ZKButton* mcheckupdatePtr;
static ZKButton* mhide1Ptr;
static ZKButton* mboiling_backPtr;
static ZKTextView* mTextView20Ptr;
static ZKTextView* mtextNamePtr;
static ZKTextView* mlinePtr;
static ZKWindow* mWindow1Ptr;
static ZKWindow* mUpdateWndPtr;
static ZKTextView* mTextViewTypePtr;
static ZKWindow* mResfFctSettingsPtr;
static ZKTextView* mTextViewUpdateMessagePtr;
static ZKSeekBar* mOtaBarPtr;
static ZKWindow* mOtaWndPtr;
static ZKButton* mBoilingpointPtr;
static ZKButton* mBoilingYesPtr;
static ZKTextView* mTempFeiDianPtr;
static ZKTextView* mTextView24Ptr;
static ZKTextView* mTextView19Ptr;
static ZKSeekBar* mSeekBar2Ptr;
static ZKWindow* mBoilingpointWndPtr;
static ZKButton* mButton3Ptr;
static ZKButton* mButton28Ptr;
static ZKButton* mButton33Ptr;
static ZKButton* mButton29Ptr;
static ZKTextView* mTextView18Ptr;
static ZKButton* mButton34Ptr;
static ZKTextView* mTextView17Ptr;
static ZKButton* mButton32Ptr;
static ZKButton* mButton26Ptr;
static ZKButton* mButton27Ptr;
static ZKButton* mButton25Ptr;
static ZKButton* mButton35Ptr;
static ZKButton* mButton31Ptr;
static ZKButton* mButton30Ptr;
static ZKButton* mButton36Ptr;
static ZKWindow* mFactoryPassWndPtr;
static ZKTextView* mTextView16Ptr;
static ZKTextView* mTextView15Ptr;
static ZKButton* mButton2Ptr;
static ZKTextView* mTextView14Ptr;
static ZKButton* mButton1Ptr;
static ZKTextView* mTextView13Ptr;
static ZKWindow* mFactoryModeWndPtr;
static ZKTextView* mTextViewBrigValuePtr;
static ZKTextView* mTextView12Ptr;
static ZKWindow* msetWndPtr;
static ZKButton* mButtonStartUpdatePtr;
static ZKTextView* mVersionPtr;
static ZKTextView* mTextView32Ptr;
static ZKTextView* mVersionTipPtr;
static ZKTextView* mMcuVersionPtr;
static ZKButton* mButton4Ptr;
static ZKSeekBar* mlightBarPtr;
static ZKButton* mtimePtr;
static ZKButton* mwifiPtr;
static ZKButton* mtouchSoundPtr;
static ZKButton* mlightPtr;
static ZKButton* mlockPtr;
static ZKButton* mwaterModePtr;
static ZKButton* mboilingPointPtr;
static ZKButton* mfilterPtr;
static ZKButton* mrestorePtr;
static ZKButton* miceWaterPtr;
static ZKButton* miceCakePtr;
static ZKTextView* mTextView5Ptr;
static ZKTextView* mTextView1Ptr;
static ZKTextView* mTextView2Ptr;
static ZKTextView* mTextView3Ptr;
static ZKTextView* mTextView4Ptr;
static ZKTextView* mTextView6Ptr;
static ZKTextView* mTextView7Ptr;
static ZKTextView* mTextView8Ptr;
static ZKTextView* mTextView9Ptr;
static ZKTextView* mTextView10Ptr;
static ZKTextView* mTextView11Ptr;
static setActivity* mActivityPtr;

/*register activity*/
REGISTER_ACTIVITY(setActivity);

typedef struct {
	int id; // 定时器ID ， 不能重复
	int time; // 定时器  时间间隔  单位 毫秒
}S_ACTIVITY_TIMEER;

#include "logic/setLogic.cc"

/***********/
typedef struct {
    int id;
    const char *pApp;
} SAppInfo;

/**
 *点击跳转window
 */
static SAppInfo sAppInfoTab[] = {
//  { ID_MAIN_TEXT, "TextViewActivity" },
};

/***************/
typedef bool (*ButtonCallback)(ZKButton *pButton);
/**
 * button onclick表
 */
typedef struct {
    int id;
    ButtonCallback callback;
}S_ButtonCallback;

/*TAG:ButtonCallbackTab按键映射表*/
static S_ButtonCallback sButtonCallbackTab[] = {
    ID_SET_Button10, onButtonClick_Button10,
    ID_SET_Button9, onButtonClick_Button9,
    ID_SET_Button8, onButtonClick_Button8,
    ID_SET_lockSwitch, onButtonClick_lockSwitch,
    ID_SET_soundSwitch, onButtonClick_soundSwitch,
    ID_SET_Button_back, onButtonClick_Button_back,
    ID_SET_Button6, onButtonClick_Button6,
    ID_SET_Button5, onButtonClick_Button5,
    ID_SET_UpdateOkButton, onButtonClick_UpdateOkButton,
    ID_SET_hideNew, onButtonClick_hideNew,
    ID_SET_hide2, onButtonClick_hide2,
    ID_SET_reset, onButtonClick_reset,
    ID_SET_checkupdate, onButtonClick_checkupdate,
    ID_SET_hide1, onButtonClick_hide1,
    ID_SET_boiling_back, onButtonClick_boiling_back,
    ID_SET_Boilingpoint, onButtonClick_Boilingpoint,
    ID_SET_BoilingYes, onButtonClick_BoilingYes,
    ID_SET_Button3, onButtonClick_Button3,
    ID_SET_Button28, onButtonClick_Button28,
    ID_SET_Button33, onButtonClick_Button33,
    ID_SET_Button29, onButtonClick_Button29,
    ID_SET_Button34, onButtonClick_Button34,
    ID_SET_Button32, onButtonClick_Button32,
    ID_SET_Button26, onButtonClick_Button26,
    ID_SET_Button27, onButtonClick_Button27,
    ID_SET_Button25, onButtonClick_Button25,
    ID_SET_Button35, onButtonClick_Button35,
    ID_SET_Button31, onButtonClick_Button31,
    ID_SET_Button30, onButtonClick_Button30,
    ID_SET_Button36, onButtonClick_Button36,
    ID_SET_Button2, onButtonClick_Button2,
    ID_SET_Button1, onButtonClick_Button1,
    ID_SET_ButtonStartUpdate, onButtonClick_ButtonStartUpdate,
    ID_SET_Button4, onButtonClick_Button4,
    ID_SET_time, onButtonClick_time,
    ID_SET_wifi, onButtonClick_wifi,
    ID_SET_touchSound, onButtonClick_touchSound,
    ID_SET_light, onButtonClick_light,
    ID_SET_lock, onButtonClick_lock,
    ID_SET_waterMode, onButtonClick_waterMode,
    ID_SET_boilingPoint, onButtonClick_boilingPoint,
    ID_SET_filter, onButtonClick_filter,
    ID_SET_restore, onButtonClick_restore,
    ID_SET_iceWater, onButtonClick_iceWater,
    ID_SET_iceCake, onButtonClick_iceCake,
};
/***************/


typedef void (*SeekBarCallback)(ZKSeekBar *pSeekBar, int progress);
typedef struct {
    int id;
    SeekBarCallback callback;
}S_ZKSeekBarCallback;
/*TAG:SeekBarCallbackTab*/
static S_ZKSeekBarCallback SZKSeekBarCallbackTab[] = {
    ID_SET_lockBar, onProgressChanged_lockBar,
    ID_SET_OtaBar, onProgressChanged_OtaBar,
    ID_SET_SeekBar2, onProgressChanged_SeekBar2,
    ID_SET_lightBar, onProgressChanged_lightBar,
};


typedef int (*ListViewGetItemCountCallback)(const ZKListView *pListView);
typedef void (*ListViewobtainListItemDataCallback)(ZKListView *pListView,ZKListView::ZKListItem *pListItem, int index);
typedef void (*ListViewonItemClickCallback)(ZKListView *pListView, int index, int id);
typedef struct {
    int id;
    ListViewGetItemCountCallback getListItemCountCallback;
    ListViewobtainListItemDataCallback obtainListItemDataCallback;
    ListViewonItemClickCallback onItemClickCallback;
}S_ListViewFunctionsCallback;
/*TAG:ListViewFunctionsCallback*/
static S_ListViewFunctionsCallback SListViewFunctionsCallbackTab[] = {
};


typedef void (*SlideWindowItemClickCallback)(ZKSlideWindow *pSlideWindow, int index);
typedef struct {
    int id;
    SlideWindowItemClickCallback onSlideItemClickCallback;
}S_SlideWindowItemClickCallback;
/*TAG:SlideWindowFunctionsCallbackTab*/
static S_SlideWindowItemClickCallback SSlideWindowItemClickCallbackTab[] = {
};


typedef void (*EditTextInputCallback)(const std::string &text);
typedef struct {
    int id;
    EditTextInputCallback onEditTextChangedCallback;
}S_EditTextInputCallback;
/*TAG:EditTextInputCallback*/
static S_EditTextInputCallback SEditTextInputCallbackTab[] = {
};

typedef void (*VideoViewCallback)(ZKVideoView *pVideoView, int msg);
typedef struct {
    int id; //VideoView ID
    bool loop; // 是否是轮播类型
    int defaultvolume;//轮播类型时,默认视频音量
    VideoViewCallback onVideoViewCallback;
}S_VideoViewCallback;
/*TAG:VideoViewCallback*/
static S_VideoViewCallback SVideoViewCallbackTab[] = {
};


setActivity::setActivity() {
	//todo add init code here
	mVideoLoopIndex = -1;
	mVideoLoopErrorCount = 0;
}

setActivity::~setActivity() {
  //todo add init file here
  // 退出应用时需要反注册
    EASYUICONTEXT->unregisterGlobalTouchListener(this);
    unregisterProtocolDataUpdateListener(onProtocolDataUpdate);
    onUI_quit();
    mActivityPtr = NULL;
    mTextNewMaxPtr = NULL;
    mlocktimePtr = NULL;
    mTextView23Ptr = NULL;
    mButton10Ptr = NULL;
    mButton9Ptr = NULL;
    mButton8Ptr = NULL;
    mTextView30Ptr = NULL;
    mTextView29Ptr = NULL;
    mTextView27Ptr = NULL;
    mTextView26Ptr = NULL;
    mlockBarPtr = NULL;
    mlockSwitchPtr = NULL;
    mTextView22Ptr = NULL;
    mWindow4Ptr = NULL;
    mlockWndPtr = NULL;
    msoundSwitchPtr = NULL;
    mName1Ptr = NULL;
    mTextView28Ptr = NULL;
    mButton_backPtr = NULL;
    mButton6Ptr = NULL;
    mButton5Ptr = NULL;
    mWindow3Ptr = NULL;
    msoundWndPtr = NULL;
    mVersionTip0Ptr = NULL;
    mUpdateOkButtonPtr = NULL;
    mhideNewPtr = NULL;
    mVersionTipNewPtr = NULL;
    mTextView21Ptr = NULL;
    mNewVersionWndPtr = NULL;
    mhide2Ptr = NULL;
    mresetPtr = NULL;
    mTextupdateValuePtr = NULL;
    mVersionTip1Ptr = NULL;
    mcheckupdatePtr = NULL;
    mhide1Ptr = NULL;
    mboiling_backPtr = NULL;
    mTextView20Ptr = NULL;
    mtextNamePtr = NULL;
    mlinePtr = NULL;
    mWindow1Ptr = NULL;
    mUpdateWndPtr = NULL;
    mTextViewTypePtr = NULL;
    mResfFctSettingsPtr = NULL;
    mTextViewUpdateMessagePtr = NULL;
    mOtaBarPtr = NULL;
    mOtaWndPtr = NULL;
    mBoilingpointPtr = NULL;
    mBoilingYesPtr = NULL;
    mTempFeiDianPtr = NULL;
    mTextView24Ptr = NULL;
    mTextView19Ptr = NULL;
    mSeekBar2Ptr = NULL;
    mBoilingpointWndPtr = NULL;
    mButton3Ptr = NULL;
    mButton28Ptr = NULL;
    mButton33Ptr = NULL;
    mButton29Ptr = NULL;
    mTextView18Ptr = NULL;
    mButton34Ptr = NULL;
    mTextView17Ptr = NULL;
    mButton32Ptr = NULL;
    mButton26Ptr = NULL;
    mButton27Ptr = NULL;
    mButton25Ptr = NULL;
    mButton35Ptr = NULL;
    mButton31Ptr = NULL;
    mButton30Ptr = NULL;
    mButton36Ptr = NULL;
    mFactoryPassWndPtr = NULL;
    mTextView16Ptr = NULL;
    mTextView15Ptr = NULL;
    mButton2Ptr = NULL;
    mTextView14Ptr = NULL;
    mButton1Ptr = NULL;
    mTextView13Ptr = NULL;
    mFactoryModeWndPtr = NULL;
    mTextViewBrigValuePtr = NULL;
    mTextView12Ptr = NULL;
    msetWndPtr = NULL;
    mButtonStartUpdatePtr = NULL;
    mVersionPtr = NULL;
    mTextView32Ptr = NULL;
    mVersionTipPtr = NULL;
    mMcuVersionPtr = NULL;
    mButton4Ptr = NULL;
    mlightBarPtr = NULL;
    mtimePtr = NULL;
    mwifiPtr = NULL;
    mtouchSoundPtr = NULL;
    mlightPtr = NULL;
    mlockPtr = NULL;
    mwaterModePtr = NULL;
    mboilingPointPtr = NULL;
    mfilterPtr = NULL;
    mrestorePtr = NULL;
    miceWaterPtr = NULL;
    miceCakePtr = NULL;
    mTextView5Ptr = NULL;
    mTextView1Ptr = NULL;
    mTextView2Ptr = NULL;
    mTextView3Ptr = NULL;
    mTextView4Ptr = NULL;
    mTextView6Ptr = NULL;
    mTextView7Ptr = NULL;
    mTextView8Ptr = NULL;
    mTextView9Ptr = NULL;
    mTextView10Ptr = NULL;
    mTextView11Ptr = NULL;
}

const char* setActivity::getAppName() const{
	return "set.ftu";
}

//TAG:onCreate
void setActivity::onCreate() {
	Activity::onCreate();
    mTextNewMaxPtr = (ZKTextView*)findControlByID(ID_SET_TextNewMax);
    mlocktimePtr = (ZKTextView*)findControlByID(ID_SET_locktime);
    mTextView23Ptr = (ZKTextView*)findControlByID(ID_SET_TextView23);
    mButton10Ptr = (ZKButton*)findControlByID(ID_SET_Button10);
    mButton9Ptr = (ZKButton*)findControlByID(ID_SET_Button9);
    mButton8Ptr = (ZKButton*)findControlByID(ID_SET_Button8);
    mTextView30Ptr = (ZKTextView*)findControlByID(ID_SET_TextView30);
    mTextView29Ptr = (ZKTextView*)findControlByID(ID_SET_TextView29);
    mTextView27Ptr = (ZKTextView*)findControlByID(ID_SET_TextView27);
    mTextView26Ptr = (ZKTextView*)findControlByID(ID_SET_TextView26);
    mlockBarPtr = (ZKSeekBar*)findControlByID(ID_SET_lockBar);if(mlockBarPtr!= NULL){mlockBarPtr->setSeekBarChangeListener(this);}
    mlockSwitchPtr = (ZKButton*)findControlByID(ID_SET_lockSwitch);
    mTextView22Ptr = (ZKTextView*)findControlByID(ID_SET_TextView22);
    mWindow4Ptr = (ZKWindow*)findControlByID(ID_SET_Window4);
    mlockWndPtr = (ZKWindow*)findControlByID(ID_SET_lockWnd);
    msoundSwitchPtr = (ZKButton*)findControlByID(ID_SET_soundSwitch);
    mName1Ptr = (ZKTextView*)findControlByID(ID_SET_Name1);
    mTextView28Ptr = (ZKTextView*)findControlByID(ID_SET_TextView28);
    mButton_backPtr = (ZKButton*)findControlByID(ID_SET_Button_back);
    mButton6Ptr = (ZKButton*)findControlByID(ID_SET_Button6);
    mButton5Ptr = (ZKButton*)findControlByID(ID_SET_Button5);
    mWindow3Ptr = (ZKWindow*)findControlByID(ID_SET_Window3);
    msoundWndPtr = (ZKWindow*)findControlByID(ID_SET_soundWnd);
    mVersionTip0Ptr = (ZKTextView*)findControlByID(ID_SET_VersionTip0);
    mUpdateOkButtonPtr = (ZKButton*)findControlByID(ID_SET_UpdateOkButton);
    mhideNewPtr = (ZKButton*)findControlByID(ID_SET_hideNew);
    mVersionTipNewPtr = (ZKTextView*)findControlByID(ID_SET_VersionTipNew);
    mTextView21Ptr = (ZKTextView*)findControlByID(ID_SET_TextView21);
    mNewVersionWndPtr = (ZKWindow*)findControlByID(ID_SET_NewVersionWnd);
    mhide2Ptr = (ZKButton*)findControlByID(ID_SET_hide2);
    mresetPtr = (ZKButton*)findControlByID(ID_SET_reset);
    mTextupdateValuePtr = (ZKTextView*)findControlByID(ID_SET_TextupdateValue);
    mVersionTip1Ptr = (ZKTextView*)findControlByID(ID_SET_VersionTip1);
    mcheckupdatePtr = (ZKButton*)findControlByID(ID_SET_checkupdate);
    mhide1Ptr = (ZKButton*)findControlByID(ID_SET_hide1);
    mboiling_backPtr = (ZKButton*)findControlByID(ID_SET_boiling_back);
    mTextView20Ptr = (ZKTextView*)findControlByID(ID_SET_TextView20);
    mtextNamePtr = (ZKTextView*)findControlByID(ID_SET_textName);
    mlinePtr = (ZKTextView*)findControlByID(ID_SET_line);
    mWindow1Ptr = (ZKWindow*)findControlByID(ID_SET_Window1);
    mUpdateWndPtr = (ZKWindow*)findControlByID(ID_SET_UpdateWnd);
    mTextViewTypePtr = (ZKTextView*)findControlByID(ID_SET_TextViewType);
    mResfFctSettingsPtr = (ZKWindow*)findControlByID(ID_SET_ResfFctSettings);
    mTextViewUpdateMessagePtr = (ZKTextView*)findControlByID(ID_SET_TextViewUpdateMessage);
    mOtaBarPtr = (ZKSeekBar*)findControlByID(ID_SET_OtaBar);if(mOtaBarPtr!= NULL){mOtaBarPtr->setSeekBarChangeListener(this);}
    mOtaWndPtr = (ZKWindow*)findControlByID(ID_SET_OtaWnd);
    mBoilingpointPtr = (ZKButton*)findControlByID(ID_SET_Boilingpoint);
    mBoilingYesPtr = (ZKButton*)findControlByID(ID_SET_BoilingYes);
    mTempFeiDianPtr = (ZKTextView*)findControlByID(ID_SET_TempFeiDian);
    mTextView24Ptr = (ZKTextView*)findControlByID(ID_SET_TextView24);
    mTextView19Ptr = (ZKTextView*)findControlByID(ID_SET_TextView19);
    mSeekBar2Ptr = (ZKSeekBar*)findControlByID(ID_SET_SeekBar2);if(mSeekBar2Ptr!= NULL){mSeekBar2Ptr->setSeekBarChangeListener(this);}
    mBoilingpointWndPtr = (ZKWindow*)findControlByID(ID_SET_BoilingpointWnd);
    mButton3Ptr = (ZKButton*)findControlByID(ID_SET_Button3);
    mButton28Ptr = (ZKButton*)findControlByID(ID_SET_Button28);
    mButton33Ptr = (ZKButton*)findControlByID(ID_SET_Button33);
    mButton29Ptr = (ZKButton*)findControlByID(ID_SET_Button29);
    mTextView18Ptr = (ZKTextView*)findControlByID(ID_SET_TextView18);
    mButton34Ptr = (ZKButton*)findControlByID(ID_SET_Button34);
    mTextView17Ptr = (ZKTextView*)findControlByID(ID_SET_TextView17);
    mButton32Ptr = (ZKButton*)findControlByID(ID_SET_Button32);
    mButton26Ptr = (ZKButton*)findControlByID(ID_SET_Button26);
    mButton27Ptr = (ZKButton*)findControlByID(ID_SET_Button27);
    mButton25Ptr = (ZKButton*)findControlByID(ID_SET_Button25);
    mButton35Ptr = (ZKButton*)findControlByID(ID_SET_Button35);
    mButton31Ptr = (ZKButton*)findControlByID(ID_SET_Button31);
    mButton30Ptr = (ZKButton*)findControlByID(ID_SET_Button30);
    mButton36Ptr = (ZKButton*)findControlByID(ID_SET_Button36);
    mFactoryPassWndPtr = (ZKWindow*)findControlByID(ID_SET_FactoryPassWnd);
    mTextView16Ptr = (ZKTextView*)findControlByID(ID_SET_TextView16);
    mTextView15Ptr = (ZKTextView*)findControlByID(ID_SET_TextView15);
    mButton2Ptr = (ZKButton*)findControlByID(ID_SET_Button2);
    mTextView14Ptr = (ZKTextView*)findControlByID(ID_SET_TextView14);
    mButton1Ptr = (ZKButton*)findControlByID(ID_SET_Button1);
    mTextView13Ptr = (ZKTextView*)findControlByID(ID_SET_TextView13);
    mFactoryModeWndPtr = (ZKWindow*)findControlByID(ID_SET_FactoryModeWnd);
    mTextViewBrigValuePtr = (ZKTextView*)findControlByID(ID_SET_TextViewBrigValue);
    mTextView12Ptr = (ZKTextView*)findControlByID(ID_SET_TextView12);
    msetWndPtr = (ZKWindow*)findControlByID(ID_SET_setWnd);
    mButtonStartUpdatePtr = (ZKButton*)findControlByID(ID_SET_ButtonStartUpdate);
    mVersionPtr = (ZKTextView*)findControlByID(ID_SET_Version);
    mTextView32Ptr = (ZKTextView*)findControlByID(ID_SET_TextView32);
    mVersionTipPtr = (ZKTextView*)findControlByID(ID_SET_VersionTip);
    mMcuVersionPtr = (ZKTextView*)findControlByID(ID_SET_McuVersion);
    mButton4Ptr = (ZKButton*)findControlByID(ID_SET_Button4);
    mlightBarPtr = (ZKSeekBar*)findControlByID(ID_SET_lightBar);if(mlightBarPtr!= NULL){mlightBarPtr->setSeekBarChangeListener(this);}
    mtimePtr = (ZKButton*)findControlByID(ID_SET_time);
    mwifiPtr = (ZKButton*)findControlByID(ID_SET_wifi);
    mtouchSoundPtr = (ZKButton*)findControlByID(ID_SET_touchSound);
    mlightPtr = (ZKButton*)findControlByID(ID_SET_light);
    mlockPtr = (ZKButton*)findControlByID(ID_SET_lock);
    mwaterModePtr = (ZKButton*)findControlByID(ID_SET_waterMode);
    mboilingPointPtr = (ZKButton*)findControlByID(ID_SET_boilingPoint);
    mfilterPtr = (ZKButton*)findControlByID(ID_SET_filter);
    mrestorePtr = (ZKButton*)findControlByID(ID_SET_restore);
    miceWaterPtr = (ZKButton*)findControlByID(ID_SET_iceWater);
    miceCakePtr = (ZKButton*)findControlByID(ID_SET_iceCake);
    mTextView5Ptr = (ZKTextView*)findControlByID(ID_SET_TextView5);
    mTextView1Ptr = (ZKTextView*)findControlByID(ID_SET_TextView1);
    mTextView2Ptr = (ZKTextView*)findControlByID(ID_SET_TextView2);
    mTextView3Ptr = (ZKTextView*)findControlByID(ID_SET_TextView3);
    mTextView4Ptr = (ZKTextView*)findControlByID(ID_SET_TextView4);
    mTextView6Ptr = (ZKTextView*)findControlByID(ID_SET_TextView6);
    mTextView7Ptr = (ZKTextView*)findControlByID(ID_SET_TextView7);
    mTextView8Ptr = (ZKTextView*)findControlByID(ID_SET_TextView8);
    mTextView9Ptr = (ZKTextView*)findControlByID(ID_SET_TextView9);
    mTextView10Ptr = (ZKTextView*)findControlByID(ID_SET_TextView10);
    mTextView11Ptr = (ZKTextView*)findControlByID(ID_SET_TextView11);
	mActivityPtr = this;
	onUI_init();
  registerProtocolDataUpdateListener(onProtocolDataUpdate);
  rigesterActivityTimer();
}

void setActivity::onClick(ZKBase *pBase) {
	//TODO: add widget onClik code 
    int buttonTablen = sizeof(sButtonCallbackTab) / sizeof(S_ButtonCallback);
    for (int i = 0; i < buttonTablen; ++i) {
        if (sButtonCallbackTab[i].id == pBase->getID()) {
            if (sButtonCallbackTab[i].callback((ZKButton*)pBase)) {
            	return;
            }
            break;
        }
    }


    int len = sizeof(sAppInfoTab) / sizeof(sAppInfoTab[0]);
    for (int i = 0; i < len; ++i) {
        if (sAppInfoTab[i].id == pBase->getID()) {
            EASYUICONTEXT->openActivity(sAppInfoTab[i].pApp);
            return;
        }
    }

	Activity::onClick(pBase);
}

void setActivity::onResume() {
	Activity::onResume();
	EASYUICONTEXT->registerGlobalTouchListener(this);
	startVideoLoopPlayback();
	onUI_show();
}

void setActivity::onPause() {
	Activity::onPause();
	EASYUICONTEXT->unregisterGlobalTouchListener(this);
	stopVideoLoopPlayback();
	onUI_hide();
}

void setActivity::onIntent(const Intent *intentPtr) {
	Activity::onIntent(intentPtr);
	onUI_intent(intentPtr);
}

bool setActivity::onTimer(int id) {
	return onUI_Timer(id);
}

void setActivity::onProgressChanged(ZKSeekBar *pSeekBar, int progress){

    int seekBarTablen = sizeof(SZKSeekBarCallbackTab) / sizeof(S_ZKSeekBarCallback);
    for (int i = 0; i < seekBarTablen; ++i) {
        if (SZKSeekBarCallbackTab[i].id == pSeekBar->getID()) {
            SZKSeekBarCallbackTab[i].callback(pSeekBar, progress);
            break;
        }
    }
}

int setActivity::getListItemCount(const ZKListView *pListView) const{
    int tablen = sizeof(SListViewFunctionsCallbackTab) / sizeof(S_ListViewFunctionsCallback);
    for (int i = 0; i < tablen; ++i) {
        if (SListViewFunctionsCallbackTab[i].id == pListView->getID()) {
            return SListViewFunctionsCallbackTab[i].getListItemCountCallback(pListView);
            break;
        }
    }
    return 0;
}

void setActivity::obtainListItemData(ZKListView *pListView,ZKListView::ZKListItem *pListItem, int index){
    int tablen = sizeof(SListViewFunctionsCallbackTab) / sizeof(S_ListViewFunctionsCallback);
    for (int i = 0; i < tablen; ++i) {
        if (SListViewFunctionsCallbackTab[i].id == pListView->getID()) {
            SListViewFunctionsCallbackTab[i].obtainListItemDataCallback(pListView, pListItem, index);
            break;
        }
    }
}

void setActivity::onItemClick(ZKListView *pListView, int index, int id){
    int tablen = sizeof(SListViewFunctionsCallbackTab) / sizeof(S_ListViewFunctionsCallback);
    for (int i = 0; i < tablen; ++i) {
        if (SListViewFunctionsCallbackTab[i].id == pListView->getID()) {
            SListViewFunctionsCallbackTab[i].onItemClickCallback(pListView, index, id);
            break;
        }
    }
}

void setActivity::onSlideItemClick(ZKSlideWindow *pSlideWindow, int index) {
    int tablen = sizeof(SSlideWindowItemClickCallbackTab) / sizeof(S_SlideWindowItemClickCallback);
    for (int i = 0; i < tablen; ++i) {
        if (SSlideWindowItemClickCallbackTab[i].id == pSlideWindow->getID()) {
            SSlideWindowItemClickCallbackTab[i].onSlideItemClickCallback(pSlideWindow, index);
            break;
        }
    }
}

bool setActivity::onTouchEvent(const MotionEvent &ev) {
    return onsetActivityTouchEvent(ev);
}

void setActivity::onTextChanged(ZKTextView *pTextView, const std::string &text) {
    int tablen = sizeof(SEditTextInputCallbackTab) / sizeof(S_EditTextInputCallback);
    for (int i = 0; i < tablen; ++i) {
        if (SEditTextInputCallbackTab[i].id == pTextView->getID()) {
            SEditTextInputCallbackTab[i].onEditTextChangedCallback(text);
            break;
        }
    }
}

void setActivity::rigesterActivityTimer() {
    int tablen = sizeof(REGISTER_ACTIVITY_TIMER_TAB) / sizeof(S_ACTIVITY_TIMEER);
    for (int i = 0; i < tablen; ++i) {
        S_ACTIVITY_TIMEER temp = REGISTER_ACTIVITY_TIMER_TAB[i];
        registerTimer(temp.id, temp.time);
    }
}


void setActivity::onVideoPlayerMessage(ZKVideoView *pVideoView, int msg) {
    int tablen = sizeof(SVideoViewCallbackTab) / sizeof(S_VideoViewCallback);
    for (int i = 0; i < tablen; ++i) {
        if (SVideoViewCallbackTab[i].id == pVideoView->getID()) {
        	if (SVideoViewCallbackTab[i].loop) {
                //循环播放
        		videoLoopPlayback(pVideoView, msg, i);
        	} else if (SVideoViewCallbackTab[i].onVideoViewCallback != NULL){
        	    SVideoViewCallbackTab[i].onVideoViewCallback(pVideoView, msg);
        	}
            break;
        }
    }
}

void setActivity::videoLoopPlayback(ZKVideoView *pVideoView, int msg, size_t callbackTabIndex) {

	switch (msg) {
	case ZKVideoView::E_MSGTYPE_VIDEO_PLAY_STARTED:
		LOGD("ZKVideoView::E_MSGTYPE_VIDEO_PLAY_STARTED\n");
    if (callbackTabIndex >= (sizeof(SVideoViewCallbackTab)/sizeof(S_VideoViewCallback))) {
      break;
    }
		pVideoView->setVolume(SVideoViewCallbackTab[callbackTabIndex].defaultvolume / 10.0);
		mVideoLoopErrorCount = 0;
		break;
	case ZKVideoView::E_MSGTYPE_VIDEO_PLAY_ERROR:
		/**错误处理 */
		++mVideoLoopErrorCount;
		if (mVideoLoopErrorCount > 100) {
			LOGD("video loop error counts > 100, quit loop playback !");
            break;
		} //不用break, 继续尝试播放下一个
	case ZKVideoView::E_MSGTYPE_VIDEO_PLAY_COMPLETED:
		LOGD("ZKVideoView::E_MSGTYPE_VIDEO_PLAY_COMPLETED\n");
        std::vector<std::string> videolist;
        std::string fileName(getAppName());
        if (fileName.size() < 4) {
             LOGD("getAppName size < 4, ignore!");
             break;
        }
        fileName = fileName.substr(0, fileName.length() - 4) + "_video_list.txt";
        fileName = "/mnt/extsd/" + fileName;
        if (!parseVideoFileList(fileName.c_str(), videolist)) {
            LOGD("parseVideoFileList failed !");
		    break;
        }
		if (pVideoView && !videolist.empty()) {
			mVideoLoopIndex = (mVideoLoopIndex + 1) % videolist.size();
			pVideoView->play(videolist[mVideoLoopIndex].c_str());
		}
		break;
	}
}

void setActivity::startVideoLoopPlayback() {
    int tablen = sizeof(SVideoViewCallbackTab) / sizeof(S_VideoViewCallback);
    for (int i = 0; i < tablen; ++i) {
    	if (SVideoViewCallbackTab[i].loop) {
    		ZKVideoView* videoView = (ZKVideoView*)findControlByID(SVideoViewCallbackTab[i].id);
    		if (!videoView) {
    			return;
    		}
    		//循环播放
    		videoLoopPlayback(videoView, ZKVideoView::E_MSGTYPE_VIDEO_PLAY_COMPLETED, i);
    		return;
    	}
    }
}

void setActivity::stopVideoLoopPlayback() {
    int tablen = sizeof(SVideoViewCallbackTab) / sizeof(S_VideoViewCallback);
    for (int i = 0; i < tablen; ++i) {
    	if (SVideoViewCallbackTab[i].loop) {
    		ZKVideoView* videoView = (ZKVideoView*)findControlByID(SVideoViewCallbackTab[i].id);
    		if (!videoView) {
    			return;
    		}
    		if (videoView->isPlaying()) {
    		    videoView->stop();
    		}
    		return;
    	}
    }
}

bool setActivity::parseVideoFileList(const char *pFileListPath, std::vector<string>& mediaFileList) {
	mediaFileList.clear();
	if (NULL == pFileListPath || 0 == strlen(pFileListPath)) {
        LOGD("video file list is null!");
		return false;
	}

	ifstream is(pFileListPath, ios_base::in);
	if (!is.is_open()) {
		LOGD("cann't open file %s \n", pFileListPath);
		return false;
	}
	char tmp[1024] = {0};
	while (is.getline(tmp, sizeof(tmp))) {
		string str = tmp;
		removeCharFromString(str, '\"');
		removeCharFromString(str, '\r');
		removeCharFromString(str, '\n');
		if (str.size() > 1) {
     		mediaFileList.push_back(str.c_str());
		}
	}
  LOGD("(f:%s, l:%d) parse fileList[%s], get [%d]files", __FUNCTION__,
      __LINE__, pFileListPath, int(mediaFileList.size()));
  for (std::vector<string>::size_type i = 0; i < mediaFileList.size(); i++) {
    LOGD("file[%d]:[%s]", int(i), mediaFileList[i].c_str());
  }
	is.close();

	return true;
}

int setActivity::removeCharFromString(string& nString, char c) {
    string::size_type   pos;
    while(1) {
        pos = nString.find(c);
        if(pos != string::npos) {
            nString.erase(pos, 1);
        } else {
            break;
        }
    }
    return (int)nString.size();
}

void setActivity::registerUserTimer(int id, int time) {
	registerTimer(id, time);
}

void setActivity::unregisterUserTimer(int id) {
	unregisterTimer(id);
}

void setActivity::resetUserTimer(int id, int time) {
	resetTimer(id, time);
}